<template>
  <div class="error-container">
    <div class="error-content">
      <h1 class="error-code">403</h1>
      <p class="error-desc">抱歉，您没有权限访问该页面</p>
      <a-space>
        <a-button type="primary" @click="goBack">返回上一页</a-button>
        <a-button @click="goHome">回到首页</a-button>
      </a-space>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const goBack = () => {
  router.go(-1);
};

const goHome = () => {
  router.push('/');
};
</script>

<style scoped>
.error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f5f5f5;
}

.error-content {
  text-align: center;
  padding: 40px;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  max-width: 500px;
}

.error-code {
  font-size: 72px;
  color: #f5222d;
  margin-bottom: 24px;
  font-weight: bold;
}

.error-desc {
  font-size: 20px;
  color: #333;
  margin-bottom: 24px;
}
</style> 